cmake_minimum_required(VERSION 2.6)
project(Ucop)

include_directories(
    ${PROJECT_SOURCE_DIR}/../
)

set(UcopSRC
    AtExit.h
    AtExit.cc
    ErrorHandler.h
    Exception.h
    Exception.cc
    Macros.h
    Typedefs.h
    Singleton.h
    
    Base/AtomicValue.h
    Base/Console.h
    
    Binary/ByteConverter.h
    Binary/ByteBuffer.h
    Binary/ByteBuffer.cc
    
    Crypto/BigNumber.h
    Crypto/BigNumber.cc
    Crypto/Sha1.h
    Crypto/Sha1.cc
    Crypto/Hmac.h
    Crypto/Hmac.cc
    
    Data/Rel/Field.h
    Data/Rel/Field.cc
    Data/Rel/QueryResult.h
    Data/Rel/QueryResult.cc
    Data/Rel/SqlPreparedStatement.h
    Data/Rel/SqlPreparedStatement.cc
    Data/Rel/SqlConnection.h
    Data/Rel/SqlConnection.cc
    Data/Rel/SqlConnectionFactory.h
    Data/Rel/SqlConnectionFactory.cc
    Data/Rel/SqlConnectionFactoryImpl.h
    Data/Rel/Session.h
    Data/Rel/Session.cc
    Data/Rel/SqlDelayThread.h
    Data/Rel/SqlDelayThread.cc
    Data/Rel/SqlOperation.h
    Data/Rel/SqlOperation.cc
    Data/Rel/Callbacks.h
    Data/Rel/SessionImpl.h
    
    Data/Rel/Details/MySQLConnection.h
    Data/Rel/Details/MySQLConnection.cc
    Data/Rel/Details/MySQLConnectionFactoryImpl.h
    Data/Rel/Details/MySQLConnectionFactoryImpl.cc
    Data/Rel/Details/MySQLQueryResult.h
    Data/Rel/Details/MySQLQueryResult.cc
    Data/Rel/Details/MySQLConnector.h
    Data/Rel/Details/MySQLConnector.cc
    
    DBC/DBCStore.h
    DBC/DBCLoader.h
    DBC/DBCLoader.cc
    DBC/DBCFileLoader.h
    DBC/DBCFileLoader.cc
    
    Net/SocketApi.h
    Net/TcpConnection.h
    Net/TcpConnectionFactory.h
    Net/TcpListener.h
    Net/TcpListener.cc
    Net/TcpRunnable.h
    Net/TcpRunnable.cc
    Net/TcpServer.h
    Net/TcpServer.cc
    Net/TcpSocket.h
    Net/TcpSocket.cc
    
    Policies/LifeTimePolicy.h
    Policies/CreatePolicy.h
    Policies/ThreadingModel.h
    
    Storage/SQLStorage.h
    Storage/SQLStorage.cc
    Storage/SQLStorageImpl.h
    
    System/Error.h
    System/Error.cc
    System/Event.h
    System/LockGuard.h
    System/Mutex.h
    System/Runnable.h
    System/Thread.h
    
    Util/Application.h
    Util/Application.cc
    Util/ByteConverter.h
    Util/Option.h
    Util/Option.cc
    Util/OptionSet.h
    Util/OptionSet.cc
    Util/String.h
    Util/String.cc
    Util/Configuration.h
    Util/XMLConfiguration.h
    Util/XMLConfiguration.cc
    Util/Path.h
    Util/Path.cc
    Util/Time.h
    Util/LockedQueue.h
    Util/Random.h
    Util/Random.cc
)

if(WIN32)
set(UcopSRC
    Base/Console_WIN32.h
    Base/Console_WIN32.cc
    
    Data/Rel/Field_WIN32.cc
    Data/Rel/Details/MySQLConnection_WIN32.cc

    Net/SocketApi_WIN32.cc
    Net/TcpListener_WIN32.cc
    Net/TcpSocket_WIN32.cc

    System/Error_WIN32.cc
    System/Event_WIN32.h
    System/Mutex_WIN32.h
    System/Thread_WIN32.h
    System/Thread_WIN32.cc
    
    Util/String_WIN32.cc
    Util/Time_WIN32.cc
${UcopSRC})
endif()

add_library(Ucop 
    ${UcopSRC}
)
